1. Field of the Invention
The present invention generally relates to coding and decoding apparatuses and record media having programs recorded therein, and particularly relates to a coding and decoding apparatus and a record medium having a program stored therein for coding and decoding data together with additional information.
2. Description of the Related Art
It is believed that a demand for improved performance and multifunctionality will increase with respect to the image compression/decompression technology, which improves the manipulability of high-definition still images. As an image compression/decompression algorithm that improves the manipulability of high-definition still images, JPEG (Joint Photographic Experts Group) is most widely used at present. JPEG2000, which was to be chosen as an international standard in 2001, offers an algorithm that provides higher performance than JPEG. Also, improvements in multiple functionality, flexibility and expandability for various applications are made. Because of this, JPEG2000 is now expected to be a successor of JPEG as a next-generation compression/decompression format for high-definition still images.
In personal computers which process code data compressed and encoded by such image compression/decompression technology, various viewers are installed as applications that are provided with a decoding function to decode the coded data. These viewers make it possible to obtain original image data for displaying or printing.
In recent years, the trend has been to use viewers that are provided with an encoding function in addition to the decoding function, thereby utilizing the lossless coding/decoding ability of JPEG2000. This makes it possible to encode image data a second time after it has been decoded. For example, a document image may be scanned in a horizontal position by a scanner connected to a personal computer for compression and encoding of the image. Even if the image needs to be changed to a vertical position, editing such as rotation of an image cannot be done with respect to the coded data. The coded data in the horizontal position after compression and encoding is decoded to generate original image data (perfect restoration is possible through lossless conversion), and, then, editing such as rotation is performed. The image data edited into a vertical position is then encoded a second time by the encoding function. The same applies in the case of black and white reversing.
The code format of JPEG or JPEG2000 provides a comment marker, which can be used when adding information such as comments. At the time of compression and encoding, any additional information other than image data may be conveyed in the comment marker. The decoder detects the presence of such additional information at the time of decoding. If the name of an encoder used is indicated, the contents of the additional information may be displayed at the time of decoding, or may be presented as an image property after the decoding. Such additional information can be anything, but may include, for example, the date and time of scanning, the date and time of photographing, photographing conditions, copyright information, etc. The displaying and printing of contents of such a comment marker are disclosed in Patent Documents 1 and 2.
[Patent Document 1] Japanese Patent Application Publication No. 8-137114
[Patent Document 2] Japanese Patent Application Publication No. 8-137115
FIG. 15 is a flowchart showing a related-art process of decoding and second-time encoding. As shown in the flowchart, coded data that has been compressed according to the JPEG format together with comment data are provided (step S101). Installed application (viewer) decodes the coded data, and displays the decoded image data while storing the image data and the comment data separately (step S102). If an instruction for second-time encoding is given by a user (Y at S103), only the stored image data is compressed by the encoder for second-time encoding (S104).
In the related-art as described above, additional information such as a comment is discarded when encoding takes place a second time after decoding. This is because additional information is not regarded as being important as it is not necessary for the decoding of image data. Further, all that is required in display systems is to display decoded data, so that second-time encoding is not required in the first place. For example, when coded data is decoded, an image file is generally created. At the time of second-time encoding, this image file is encoded. The format of an image file only contains the header information of the image file. If a decoded image file is provided as bitmap data, a comment (additional information) cannot be utilized for second-time encoding since the bitmap file does not contain the comment.
Unfortunately, additional information may include significant information such as copyright information. The fact that the additional information is discarded at the time of second-time encoding presents an inconvenient situation for users. As previously described, JPEG2000 achieves lossless coding. Following the decoding of lossless coded data, additional information does not need modification in most cases, yet is discarded at the time of second-time lossless coding after editing such as rotating. This presents an inconvenient situation. Furthermore, a means to enter additional information may be a manual-based interface. It is thus cumbersome and inconvenient to enter the same or similar additional information again and again for individual images.
Accordingly, there is a need for a scheme that obviates user inconvenience by improving the usage of additional information at the time of second-time encoding after decoding coded data that has been compressed and encoded.